/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package unc.pds.auth;

import java.rmi.RemoteException;
import unc.pds.exc.PDSSecurityException;
import unc.pds.model.UserRemote;
import unc.pds.util.Arch;

/**
 *
 * @author ain
 */
public interface IPDSSecurity {

    public boolean getCrPermission(Long objkey, String entity) throws RemoteException;
    public boolean getPermission(Long objkey, String act) throws RemoteException;
    public boolean getPermission(Long objkey,String field, String act) throws RemoteException;
    public boolean getPermission(Long objkey, String entity, String field, String act) throws RemoteException;

    //public boolean setPermission(Long objkey, String entity, String act, String level) throws RemoteException;

/**/    public boolean setPermission(Long objkey, Long userkey , String entity, String field, String act, boolean access)  throws RemoteException;
/**/    public boolean dropAllPermission(Long user, Long dropfor) throws RemoteException;
/**/    public boolean dropPermission(Long entityKey, Long dropfor, String entity, String field, String act) throws RemoteException;
/**/    public boolean dropPermission(Long entityKey, String entity, String field, String act) throws RemoteException;
    public UserRemote getCurrentUser() throws RemoteException;

    public Long login(String nick, String password)throws RemoteException, PDSSecurityException;
    public Long register(Arch doc)throws RemoteException, PDSSecurityException;

/**/    //public void setProtectOn(Long entityKey) throws RemoteException;

}
